<?php

class Welcome extends Controller {

	function Welcome()
	{
		parent::Controller();
		$this->load->helper('form');
	}

	function index()
	{
		//$this->load->view('welcome_message');
		$this->load->model('Model_nav', 'model_nav');
//		$test1 = $this->model_nav->findTree(1, 0);
//		pre_var_dump($test1);
//		$test2 = $this->model_nav->findTree(2, 2);
//		pre_var_dump($test2);
		$test3 = $this->model_nav->findTree(3, 4);
//		pre_var_dump($test3);
	}

	function update_urltitle(){
		$this->load->model('Model_nav', 'model_nav');
		$test1 = $this->model_nav->fetch_all();
		foreach($test1 as $item){
			$title = $item['title'];
			$url_title = post_slug($title);
			$data = array("url_title" => $url_title);
			$this->model_nav->update($item['id'], $data);
		}
	}
	/**
	 *
	 *
	 */
	function ckeditor(){
		$this->load->library('ckeditor', base_url() . 'system/plugins/ckeditor/');
        $this->ckeditor->basePath = base_url(). 'system/plugins/ckeditor/';
        $this->ckeditor->ToolbarSet = 'Basic';

        return $this->load->view("test/viewckeditor", array());
	}
	/**
	 *
	 *
	 */
	function ckeditor_integrate(){
		$this->load->library('ckeditor', base_url() . 'system/plugins/ckeditor/');
        $this->ckeditor->basePath = base_url(). 'system/plugins/ckeditor/';
        $this->ckeditor->ToolbarSet = 'Basic';

        $this->load->library('ckfinder', base_url() . 'system/plugins/ckfinder/');
		$this->ckfinder->basePath = base_url(). 'system/plugins/ckfinder/';
		$this->ckfinder->SetupCKEditor($this->ckeditor, '/system/plugins/ckfinder/');
		//$this->ckeditor->config['filebrowserBrowseUrl'] = base_url(). 'system/plugins/ckfinder/ckfinder.html';

        return $this->load->view("test/viewckeditor", array());
	}
	/**
	 *
	 *
	 */
	function ckfinder(){
		$this->load->library('ckfinder', base_url() . 'system/plugins/ckfinder/');
		$this->ckfinder->basePath = base_url(). 'system/plugins/ckfinder/';
		//echo $this->ckfinder->CreateHtml();exit;
        return $this->load->view("test/viewckfinder", array());
	}
	/**
	 *
	 *
	 */
	function ckfinderform(){
		$this->load->library('ckfinder', base_url() . 'system/plugins/ckfinder/');
		$this->ckfinder->basePath = base_url(). 'system/plugins/ckfinder/';
		//echo $this->ckfinder->CreateHtml();exit;
        return $this->load->view("test/viewckfinderform", array());
	}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */